package com.aaa.sys.mapper;

import com.aaa.sys.entity.User;
import com.aaa.sys.vo.UserPosition;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 管理员表 Mapper 接口
 * </p>
 *
 * @author ykq
 * @since 2020-11-25
 */
public interface UserMapper extends BaseMapper<User> {

    IPage<UserPosition> selectByPage(IPage<UserPosition> userPosition, @Param(Constants.WRAPPER) Wrapper<UserPosition> wrappers);

    void deletePos(Long userId);

    void savePos(@Param("userId") Long userId, @Param("positionId") Long positionId);

    UserPosition selectByUserId(Long userId);

    void updatePos(@Param("userId") Long userId, @Param("positionId") Long positionId);

    void deleteRole(Long userId);

    void saveUserRole(@Param("userId")Long userId, @Param("roleIds") List<Long> roleIds);
}
